#include "CppUTest/TestHarness.h"

extern "C"
{
#include "TimeService.h"
#include "FakeTimeService.h"
}

TEST_GROUP( TimeService )
{
	void setup()
	{
		TimeService_Create();
	}

	void teardown()
	{
		TimeService_Destroy();
	}
};

TEST( TimeService, Create )
{
	Time time;
	TimeService_GetTime( &time );
	LONGS_EQUAL( TIME_UNKNOWN, time.minuteOfDay );
	LONGS_EQUAL( TIME_UNKNOWN, time.dayOfWeek );
}

TEST( TimeService, Set )
{
	Time time;
	FakeTimeService_SetMinute( 42 );
	FakeTimeService_SetDay( 3 );
	TimeService_GetTime( &time );
	LONGS_EQUAL( 42, time.minuteOfDay );
	LONGS_EQUAL( 3, time.dayOfWeek );
}
